﻿Public Class ContentSaverAttribute
    Inherits MysteryDefaultClassAttribute

    Public Property implementing_type As Type
       
    Public Overrides Sub setUp()
        If implementing_type IsNot Nothing Then
            If implementing_type.GetInterface(GetType(IContentSaver).FullName) Is Nothing Then
                Throw New Exception(_implementing_type.FullName & " must implement " & GetType(IContentSaver).FullName)
            End If
        End If
    End Sub

End Class


''' <summary>
''' takes care of saving the content in the database
''' </summary>
''' <remarks></remarks>
Public Interface IContentSaver
    Function save(item As IContent) As CRUD?
    Function remove(item As IContent) As CRUD?
    Function read(guid As Guid) As IContent
    Function getAll(filter As IContentFilter) As IEnumerable(Of IContent)
    Function haveOne() As Boolean
End Interface
